<template>
	<view>
		<view class="alipay-con">
			<easy-loadimage :image-src="qrcode" class="img" :open-transition="true"></easy-loadimage>
			<text>支付宝支付</text>
		</view>
	</view>
</template>

<script>
	import easyLoadimage from '../../components/easy-loadimage.vue'
	import { payMoney } from '../../api/identificationApi.js'
	export default {
		data() {
			return {
				qrcode: ''
			}
		},
		onLoad(option) {
			this._payMoney(option.id)
		},
		components: {
			easyLoadimage
		},
		methods: {
			async _payMoney(id) {
				const res = await payMoney({id: id, msg_type: 2})
				console.log(res)
				// "pay_type": 1,（0-银联支付  1-原生支付）
				if (res.data.data.pay_type === 0) {
					this.qrcode = res.data.data.qrcode
				}
			}
			
		}
	}
</script>

<style lang="scss">
	.alipay-con {
		height: 100vh;
		text-align: center;
		.img {
			width: 600rpx;
			height: 600rpx;
			margin: 50px auto 0;
		}
	}
</style>
